package com.sikaryofficial.common.core.constant;

/**
 * 缓存常量信息
 *
 * @author ruoyi
 */
public class CacheConstants {
    /**
     * 缓存有效期，默认30天
     */
    public static final long EXPIRATION = 30 * 24 * 60;

    /**
     * 缓存有效期，默认30天
     */
    // public static final long EXPIRATION_H5 = 30 * 24 * 60;

    /**
     * 缓存刷新时间，默认120（分钟）
     */
    public static final long REFRESH_TIME = 120;

    /**
     * 锁超时时间
     */
    public static final int LOCK_TIME_OUT = 60;

    /**
     * 密码最大错误次数
     */
    public static final int PASSWORD_MAX_RETRY_COUNT = 5;

    /**
     * 密码锁定时间，默认10（分钟）
     */
    public static final long PASSWORD_LOCK_TIME = 10;

    /**
     * 权限缓存前缀
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 登录账户密码错误次数 redis key
     */
    public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";

    /**
     * 登录IP黑名单 cache key
     */
    public static final String SYS_LOGIN_BLACKIPLIST = SYS_CONFIG_KEY + "sys.login.blackIPList";

    /**
     * 发送邮箱验证码 redis key
     * {0} 邮箱
     */
    public static final String SEND_MAIL_CAPTCHA_KEY = "hismk:sendMail:captcha:{0}";

    /**
     * 存储多个邮箱发送的验证码
     * {0} normal or gmail
     * {1} 邮箱
     */
    public static final String SEND_MAIL_SEND_SOURCE_KEY = "hismk:sendMail:sendSource:{0}:{1}";
    /**
     * 用户头像缓存key (实际存储了用户信息，包含用户头像)
     * key = hismk:user:avatar
     * hkey = userId
     * value = 头像地址
     */
    public static final String USER_AVATAR_URL = "hismk:user:avatar";
    /**
     * 用户头像缓存key
     * {0} 用户ID
     */
    public static final String USER_LON_LAT = "hismk:user:lon:lat:{0}";
    /**
     * 用户积分缓存key
     * {0} 用户ID
     */
    public static final String USER_POINTS_BALANCE = "hismk:user:pointsBalance:{0}";
    /**
     * 登录用户编号 redis key
     * {0} 用户名
     * {1} 业务通道 (mobile,pc)
     * {2} 登录设备 (mobile,pc)
     */
    public static final String LOGIN_USERID_KEY = "login_userid:{0}:{1}:{2}";
    public static final String DAY_DETAIL_ACTIVITY_ITEM_KEY = "hismk:dayDetail:activity";
    /**
     * 日活缓存key-详情
     * {0} 日期  yyyyMMdd
     */
    public static final String DAY_DETAIL_ACTIVITY_ITEM2_KEY = DAY_DETAIL_ACTIVITY_ITEM_KEY + ":{0}";
    /**
     * 日活缓存key-详情
     * {0} 日期  yyyyMMdd
     * {1} 品牌
     */
    public static final String DAY_DETAIL_ACTIVITY_KEY = DAY_DETAIL_ACTIVITY_ITEM2_KEY + ":{1}";

    public static final String DAY_DETAIL_NO_LOGIN_ACTIVITY_ITEM_KEY = "hismk:dayDetailNoLogin:activity";
    /**
     * 日活缓存key-详情
     * {0} 日期  yyyyMMdd
     */
    public static final String DAY_DETAIL_NO_LOGIN_ACTIVITY_ITEM2_KEY = DAY_DETAIL_NO_LOGIN_ACTIVITY_ITEM_KEY + ":{0}";
    /**
     * 日活缓存key-详情
     * {0} 日期  yyyyMMdd
     * {1} 品牌
     */
    public static final String DAY_DETAIL_NO_LOGIN_ACTIVITY_KEY = DAY_DETAIL_NO_LOGIN_ACTIVITY_ITEM2_KEY + ":{1}";

    /**
     * 登录用户年龄缓存key
     * {0} 用户名
     */
    public static final String USER_AGE_KEY = "hismk:user:age:{0}";

    public static final String SHOPPING_CART_LOCK_KEY = "hismk:workbench:cart:{0}";
}
